package yangsw87.basic;

public class J15_Printer {
	
	public static void main(String[] args) {
		
		Printer p01 = new Printer("잉크젯", "삼성" , "usb", 2, 100);
		p01.Print();
		
		InkjetPrinter p02 = new InkjetPrinter();
		p02.Print();
		
		LaserPrinter p03 = new LaserPrinter();
		p03.Print();
		
		
		
	} // main
	
} // class

// 부모 클래스
class Printer {
	public String model;
	public String maker;
	public String type;
	public int papers;
	public int remains;
	
	public Printer() {
	}
	
	public Printer(String model, String maker, String type, int papers,
			int remains) {
		this.model = model;
		this.maker = maker;
		this.type = type;
		this.papers = papers;
		this.remains = remains;
	}

	public void Print() {
		System.out.println("프린터입니다!");
	--remains;
		System.out.println("용지매수는? " + papers);
	}	
}

// 자식 클래스
class InkjetPrinter extends Printer {
	public int inkRemains;
	
	@Override
	public void Print() {
		System.out.println("잉크젯프린터입니다!");
	--remains;
	}
	
}

class LaserPrinter extends Printer {
	public int tonerRemains;
	
	@Override
	public void Print() {
		System.out.println("레이저프린터입니다!");
	--remains;
	}
	
}